package com.L1ngg;

import java.util.Random;  

public class text07 {  
    public static void main(String[] args) {  
        int[] table = new int[10];  
        Random random = new Random();  
  
        // 使用Math.random()方法生成随机数，并将其转换为0到100之间的整数  
        for (int i = 0; i < table.length; i++) {  
            table[i] = (int) (random.nextFloat() * 100);  
        }  
  
        // 打印数组  
        System.out.print("table：");  
        for (int num : table) {  
            System.out.print(num + " ");  
        }  
  
        // 找出数组中的最大值和最小值  
        int max = table[0];  
        int min = table[0];  
        for (int num : table) {  
            if (num > max) {  
                max = num;  
            }  
            if (num < min) {  
                min = num;  
            }  
        }  
  
        // 打印最大值和最小值  
        System.out.println("\nMax=" + max);  
        System.out.println("Min=" + min);  
    }  
}